<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="comm.dhee.dto.M001T001"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>華信商会(株) 販売管理業務システム</title>
<meta name="renderer" content="webkit">

<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet"
	href="css/datetimepicker/bootstrap-datetimepicker.min.css"
	media="screen" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() { //ready	
		$("#btn1").click(function() {
			var r = /^\d{5}$/;
			var reg = new RegExp("^[0-9]*$"); 
			if ($("#rujuchuuCode").val() == "") {
				alert("受注コードを入力してください");
			} else if (!reg.test($("#rujuchuuCode").val())) {
				$("#rujuchuuCode").focus();
				alert("受注コード欄に半角数字を入力してください");
			}  else if (!r.test($("#rujuchuuCode").val())) {
				$("#rujuchuuCode").focus();
				alert("受注コード欄に5桁を入力してください");
			}else {
				document.pr2012.action="toPR20101.action";	
				document.pr2012.submit();
			} 
		}); //事件处理
	});
${message}

$(function() { //ready	
	$("#clean").click(function() {
		$("#td1").empty();
		$("#td2").empty();
		$("#td3").empty();
		$("#td4").empty();
		$("#td5").empty();
		
	}); //事件处理
});
</script>

<script type="text/javascript"> 

	function jiansuo1() {
		document.pr2012.action="toPR201.action";
		document.pr2012.submit();
	}
</script>

</head>

<body>
	<%@include file="common/include.jsp"%>
<form id="pr2012" name="pr2012" method="post">
		<div class="container">			
				<div class="row">
					<div class="col-md-12">
						<div class="panel panel-default">
							<div class="panel-heading">

								<div class="row">
									<div class="col-md-6" align="left">
										<font style="font-size: 14px; line-height: 29px;">売掛検索</font>
									</div>
									<div class="col-md-6" align="right">
										<input type="button" class="btn btn-primary btn-sm"
											data-toggle="modal" data-target="#goodsModal" id="btn1" value="検索"
											name="btn1" ${disabled} >
										<button type="reset" class="btn btn-default btn-sm" id="clean">クリア</button>

									</div>
								</div>
							</div>
							<div class="panel-body">
								<div class="row">
									<div class="col-md-4">
										<div class="input-group">
											<span class="input-group-addon">受注コード</span> <input
												type="text" class="form-control" id="rujuchuuCode" name="rujuchuuCode" ${readonly} value="${msg }">
											</span>
										</div>
									</div>
								</div>
								<br />
								<hr />
								<%
									M001T001 m001t001 = (M001T001) request.getAttribute("m001t001");
								M001T001 m001t002 = (M001T001) request.getAttribute("m001t002");
								%>
								<table border="0">
									<tr style="line-height: 40px;">
										<td>顧客コード：</td>
										<td style="text-decoration: underline;" id="td1">
											${m001t001.kokyakuCode }</td>
									</tr>
									<tr style="line-height: 40px;"  id="td1">
										<td>顧客名：</td>
										<td style="text-decoration: underline;"  id="td2">
											${m001t001.kokyakuMei }</td>
									</tr>
									<tr style="line-height: 40px;">
										<td>売掛残高：</td>
										<td style="text-decoration: underline;"  id="td3">
											${strUrikakeKinZandaka }</td>
									</tr>  
									<tr style="line-height: 40px;">
										<td>売掛金：</td>
										<td style="text-decoration: underline;"  id="td4">${strSumuriage}</td>
									</tr>
									<tr style="line-height: 40px;">
										<td>登録後売掛残高：</td>
										<td style="text-decoration: underline;"  id="td5">${strsumZandaka }</td>
									</tr>
								</table>

							</div>
						</div>
					</div>
				</div>
		</div>
		<div class="container">
				<div class="row">
					<div class="col-md-12">
						<div class="panel panel-default">
							<div class="panel-heading">
								<div class="row">
									<div class="col-md-6" align="left">
										<font style="font-size: 14px; line-height: 29px;">売掛登録</font>
									</div>

									<div class="col-md-6" align="right">
										<button type="submit" class="btn btn-warning btn-sm"
											data-toggle="modal" data-target="#goodsModal" id="btn2"
											name="btn2" onclick="jiansuo1()" ${disabled1}>登録</button>
									</div>
								</div>
							</div>
							<div class="panel-body">
								<div class="col-md-6">
									<div class="input-group date form_date">
										<span class="input-group-addon">納入日付（省略時今日）</span> <input
											type="text" class="form-control" name="riqi" id="riqi" readonly>
										<span class="input-group-addon"><span
											class="glyphicon glyphicon-calendar"></span></span>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
		
		</div>
</form>
	<%@include file="common/include2.jsp"%>
</body>
</html>